<div class="container"> 
	<div class="row"> 
		<div class="panel panel-info">
			<div class="panel-heading">
				<div class="panel-title">Domain Transfer</div>
			</div>
			<div class="panel-body">
				<div class="row">
					<div class="col-md-12">
						<div class="well">
							<h1 class="text-center">Domain Transfer</h1>
							<hr style="background:skyblue;height:1px;"/>
							<div class="row">
								<div class="col-md-5">
									<h3 style="margin-bottom:0;color:#E87600">Single Domain Transfer</h3>
									<h4>Enter domain name and authorization code.</h4>
									<form role="form" action="" method="post" id="domain_transfer">
										<div class="form-group">
											<label for="domainname">Domain Name</label>
											<input type="text" class="form-control" id="domainname" name="domainname" placeholder="Domain Name" onkeyup="CheckDomainInput()">
										</div>
										<div class="form-group">
											<label for="exampleInputPassword1">Authorization Code <a class="tooltips" data-toggle="tooltip" data-placement="top" title="To initiate the transfer of your domain name you will need to obtain the authorization code from your current registrar. These codes may be called secret code, epp code, or auth code. They act as a password and are unique to the domain name."><i class="glyphicon glyphicon-question-sign"></i></a></label>
											<input type="text" class="form-control" id="AuthInfo1" name="AuthInfo1" placeholder="Authorization Code" onkeyup="CheckDomainInput()">
										</div>
										<p><small><a href="#moresettings" data-toggle="collapse" >View additional settings</a></small></p>
										<div id="moresettings" class="collapse">
										<div class="form-group">
											<label for="exampleInputPassword1">Transfer Verification <a class="tooltips" data-toggle="tooltip" data-placement="bottom" title="Auto Verification approves the transfer via email confirmation. Fax verification is used to verify many domain names on one order. The Registrant information on all the submitted domains must match the information you provide."><i class="glyphicon glyphicon-question-sign"></i></a></label>
											<div class="clearfix">
												<label class="radio-inline">
												  <input type="radio" name="orderType" value="AutoVerification" checked="checked"> Auto Verification
												</label>
												<label class="radio-inline">
												  <input type="radio" name="orderType" value="Fax"> By Fax
												</label>
											</div>
										</div>
										<div class="form-group">
											<label for="exampleInputPassword1">Registrar Lock <a class="tooltips" data-toggle="tooltip" data-placement="right" title="A security feature that will not allow the domain to be transferred to another registrar; can be disabled at any time within account. See Help for more details."><i class="glyphicon glyphicon-question-sign"></i></a></label>
											<div class="clearfix">
												<label class="checkbox-inline">
													<input type="checkbox" value="1" name="Lock">
													Prevent supported domains from being transferred away
												</label>
											</div>
										</div>
										<div class="form-group">
											<label for="exampleInputPassword1">Auto Renew <a class="tooltips" data-toggle="tooltip" data-placement="right" title="Don't lose your domain! The domain will automatically renew 30 days before expiration. See Help for more details."><i class="glyphicon glyphicon-question-sign"></i></a></label>
											<div class="clearfix">
												<label class="checkbox-inline">
													<input type="checkbox" name="Renew" value="1">
													Renew domain 30 days prior to expiration 
												</label>
											</div>
										</div>
										<div class="form-group">
											<label for="exampleInputPassword1">Retain WHOIS <a class="tooltips" data-toggle="tooltip" data-placement="right" title="The domains current WhoIs information will be applied to the domain WhoIs on completion of transfer. See Help for more details."><i class="glyphicon glyphicon-question-sign"></i></a></label>
											<div class="clearfix">
												<label class="checkbox-inline">
													<input type="checkbox" value="1" name="UseContacts" checked="checked">
													Transfer current domain WHOIS contact information 
												</label>
											</div>
										</div>
										<div class="form-group">
											<label for="exampleInputPassword1">Access Password <a class="tooltips" data-toggle="tooltip" data-placement="right" title="Creates a separate DNS console for each domain. See Help for more details."><i class="glyphicon glyphicon-question-sign"></i></a></label>
											<div class="clearfix">
												<label class="checkbox-inline">
													<input type="checkbox" value="1" name="access_password">
													Set password to access directly at http://access.name-services.com 
												</label>
												<div style="padding-left:20px">
													<small>6 to 64 alphanumeric  characters. First letter must be alphabetical.</small>
													<div class="form-group row" style="margin-top:5px;">
														<div class="col-sm-6">
														  <input type="password" class="form-control" placeholder="Enter Password" maxlength="32" name="DomainPassword">
														</div>
														<div class="col-sm-6">
														  <input type="password" class="form-control"  name="Re_DomainPassword" placeholder="Password">
														</div>
													</div>
												</div>
											</div>
										</div>
										</div>
										<button type="submit" id="btn_transfer" class="btn btn-warning" onclick="return domaintransfer();" disabled="disabled">Continue</button>
									</form>
								</div>
								<div class="col-md-5 col-md-offset-2">
									
									<h4><strong>For an easy transfer make sure:</strong></h4>
									<small>
										<ul>
											<li>The domain name has NOT been newly registered in the past 60 days.</li>
											<li>The domain is unlocked.</li>
											<li>Make sure the domain is eligible for transfer from your current registrar.</li>
											<li>We send emails to the registrant and administrative contact as listed in the domain's WHOIS. Make sure that's you!</li>
											<!--  Check here. -->
										</ul>
									</small>
									<h4><strong>Questions?</strong> Call sales at 1 (425) 274-4500<br> Or try our <a href="/domains/transfer-faq.aspx">Transfer FAQs</a></h4>
								</div>
								
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
function domaintransfer()
{
	//alert($('#domain_transfer').serialize());
	$.ajax({
		url: '<?php echo base_url('enom/domaintransfer');?>',
		type: 'post',
		data: $('#domain_transfer').serialize(),
		dataType:'json',
		beforeSend: function() {
			$('#processing-modal').modal('show');
		},		
		complete: function() {
			//$(e).children('.blue').css('background','#F9B014');
			//$(e).children('.blue').children('span').text('checkout');
		},
		success: function(json) {
			if(json['message'])
			{
				$('#ajax_msg').html('<div class="alert alert-success alert-dismissable flashmsg"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>'+ json['message'] + '</div>');
				$('#ajax_msg .flashmsg').delay(5000).fadeOut('slow');
				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
				$('#processing-modal').modal('hide');
				$('#contentwrapperinner').html(json['htmlresult']);
			}
			
		}
	});
	return false;
}
function CheckDomainInput()
{
	var inputSingle = $("#domainname").val();
	var inputSingleAuthCode = $("#AuthInfo1").val();
	var activateButton = false;
	if(inputSingle !="")
	{
		if (inputSingle.indexOf(".") != -1) 
		{
			var inputArray = inputSingle.split(".");
			localTLD = inputArray[1];
			if (localTLD != "") 
			{			
				if (inputSingleAuthCode != "") 
				{
					activateButton = true;
				} 
				else 
				{
					activateButton = false;
				}
			}
		}
		else
		{
			activateButton = false;
		}
		
	}
	else
	{	
		activateButton = false;
	}
	if (activateButton) {
		// Activate submit button
		$("#btn_transfer").removeAttr("disabled");
	} else {
		// Deactivate submit button
		$("#btn_transfer").attr("disabled", "disabled");
	}
}
</script>
